Skip to content

Instantly share code, notes, and snippets.

View iqan's full-sized avatar
🎯
Focusing

Iqan Shaikh iqan

🎯
Focusing
View GitHub Profile
@iqan
iqan / funcSiteConfig.bicep
Created July 8, 2023 11:15
demo-servicebus-trigger-funcsetting
siteConfig: {
appSettings: [
{
name: 'FUNCTIONS_EXTENSION_VERSION'
value: '~4'
}
{
name: 'FUNCTIONS_WORKER_RUNTIME'
value: 'dotnet'
}
@iqan
iqan / subscriptionRoleAssignment.bicep
Created July 8, 2023 10:45
servicebus-trigger-demo-subscriptionRoleAssignment
var azureServiceBusDataOwnerRoleId = '090c5cfd-751d-490a-894a-3ce6f1109419'
resource subscriptionRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid('${servicebus.name}${servicebusSubscription.name}', userIdentity.name, azureServiceBusDataOwnerRoleId)
scope: servicebusSubscription
properties: {
principalId: userIdentity.properties.principalId
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', azureServiceBusDataOwnerRoleId)
principalType: 'ServicePrincipal'
}
@iqan
iqan / storageRoleAssignments.bicep
Created July 8, 2023 10:44
servicebus-trigger-demo-
var storageBlobDataOwnerRoleId = 'b7e6dc6d-f1e8-4753-8033-0f276bb0955b'
resource storageRoleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(storageAccount.name, functionApp.name, storageBlobDataOwnerRoleId)
scope: storageAccount
properties: {
principalId: functionApp.identity.principalId
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', storageBlobDataOwnerRoleId)
principalType: 'ServicePrincipal'
}
@iqan
iqan / functionApp.bicep
Created July 8, 2023 10:44
servicebus-trigger-demo-
resource functionApp 'Microsoft.Web/sites@2021-03-01' = {
name: '${resourcePrefix}func'
location: location
kind: 'functionapp'
identity: {
type: 'SystemAssigned, UserAssigned'
userAssignedIdentities: {
'${userIdentity.id}': {}
}
}
@iqan
iqan / userIdentity.bicep
Created July 8, 2023 10:43
servicebus-trigger-demo-userIdentity
resource userIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
name: '${resourcePrefix}id'
location: location
}
@iqan
iqan / program.cs
Created September 25, 2020 16:44
Employee Relationship LINQ
using System;
using System.Collections.Generic;
using System.Linq;
namespace employee_ex
{
class Program
{
static void Main(string[] args)
{
@iqan
iqan / main.dart
Created September 3, 2020 23:21
sort based on multiple properties
class someclass {
int quantity;
DateTime mydate;
someclass({this.quantity, this.mydate});
int compareTo(someclass second) {
int res = mydate.compareTo(second.mydate);
if (res == 0) {
return quantity.compareTo(second.quantity);
@iqan
iqan / NotifyOnPromo.cs
Created July 7, 2020 00:35
Azure Function implementation that listens to Cosmos DB updates and sends notification to Android
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Azure.Documents;
using Microsoft.Azure.NotificationHubs;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
namespace PromoNotificationFunc
{
public static class NotifyOnPromo
@iqan
iqan / main.dart
Created July 7, 2020 00:23
Flutter Mobile Application receiving notifications from Azure Notification hub
import 'package:flutter/material.dart';
import 'package:azure_notificationhubs_flutter/azure_notificationhubs_flutter.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
name: DemoApp PlayStore Release
on:
push:
branches: [ master ]
jobs:
version:
name: Create version number
runs-on: ubuntu-latest