Skip to content

Instantly share code, notes, and snippets.

@amitapl
amitapl / webjobs.props
Last active June 16, 2016 20:23
webjobs.props
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
$(CopyAllFilesToSingleFolderForPackageDependsOn);
AddWebJobFilesToPublish;
</CopyAllFilesToSingleFolderForPackageDependsOn>
<_DestinationType>AzureWebSite</_DestinationType>
</PropertyGroup>
</Project>
@amitapl
amitapl / Program.cs
Last active January 3, 2016 13:09
DotNetContinuousJobSample
using System;
using System.Threading;
namespace ContinuousHelloWorld
{
internal class Program
{
private static void Main(string[] args)
{
while (true)
@echo off
IF "%SITE_FLAVOR%" == "nodejs" (
deploy.node.cmd
) ELSE (
IF "%SITE_FLAVOR%" == "mvc4" (
deploy.mvc4.cmd
) ELSE (
echo You have to set SITE_FLAVOR setting to either "nodejs" or "mvc4"
exit /b 1
)
@amitapl
amitapl / Data.cs
Created October 1, 2012 04:58
Windows Azure Mobile Services Joined Table View
public class Data
{
public MobileServiceClient MobileService = new MobileServiceClient("", "");
private IMobileServiceTable<UserGroupExtended> userGroupExtendedTable;
public async Task<IList<UserGroupExtended>> GetGroupUsers(string groupId)
{
return await this.MobileService.GetTable<UserGroupExtended>(new { groupId = groupId }).ToListAsync();
}
@amitapl
amitapl / CustomParametersServiceFilter.cs
Created September 4, 2012 22:12
Custom parameters for azure mobile services
/// <summary>
/// Add custom parameters to each request when applying this filter to a mobile service client.
/// </summary>
public class CustomParametersServiceFilter : IServiceFilter
{
private IDictionary<string, object> parameters;
public CustomParametersServiceFilter(IDictionary<string, object> parameters)
{
this.parameters = parameters;
using Microsoft.WindowsAzure.MobileServices;
using System;
using Windows.Foundation;
namespace MobileServices
{
public class AdminServiceFilter : IServiceFilter
{
private bool disableScripts;
private string masterKey;
public static MobileServiceClient MobileService =
new MobileServiceClient(
"https://Your URL/",
"Your Application Key"
);
public MobileServiceClient BuildMobileServiceWithAdminAccess(string masterKey)
{
return App.MobileService.WithFilter(new AdminServiceFilter(true, masterKey));
}
using Microsoft.WindowsAzure.MobileServices;
using System;
using Windows.Foundation;
namespace MobileServices
{
public class AdminServiceFilter : IServiceFilter
{
private bool disableScripts;
public void SetListViewHeader()
{
_ds = new DataSet();
DataTable table = new DataTable();
_ds.Tables.Add(table);
DataColumn col = new DataColumn("Name", typeof(string));
table.Columns.Add(col);
col = new DataColumn("Date", typeof(DateTime));
table.Columns.Add(col);
public void ListSpecificApplicationTest()
{
var e = new string();
}