Skip to content

Commit 2729530

Browse files
authored
Adding AZD and bicep (#2)
* Adding architecture diagram and samples gallery metadata * Adding AZD and bicep
1 parent 384fa90 commit 2729530

18 files changed

+909
-0
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## [project-title] Changelog
2+
3+
<a name="x.y.z"></a>
4+
# x.y.z (yyyy-mm-dd)
5+
6+
*Features*
7+
* ...
8+
9+
*Bug Fixes*
10+
* ...
11+
12+
*Breaking Changes*
13+
* ...

CONTRIBUTING.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributing to [project-title]
2+
3+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
4+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
5+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
6+
7+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
8+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
9+
provided by the bot. You will only need to do this once across all repos using our CLA.
10+
11+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
12+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
13+
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
14+
15+
- [Code of Conduct](#coc)
16+
- [Issues and Bugs](#issue)
17+
- [Feature Requests](#feature)
18+
- [Submission Guidelines](#submit)
19+
20+
## <a name="coc"></a> Code of Conduct
21+
Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
22+
23+
## <a name="issue"></a> Found an Issue?
24+
If you find a bug in the source code or a mistake in the documentation, you can help us by
25+
[submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can
26+
[submit a Pull Request](#submit-pr) with a fix.
27+
28+
## <a name="feature"></a> Want a Feature?
29+
You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub
30+
Repository. If you would like to *implement* a new feature, please submit an issue with
31+
a proposal for your work first, to be sure that we can use it.
32+
33+
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
34+
35+
## <a name="submit"></a> Submission Guidelines
36+
37+
### <a name="submit-issue"></a> Submitting an Issue
38+
Before you submit an issue, search the archive, maybe your question was already answered.
39+
40+
If your issue appears to be a bug, and hasn't been reported, open a new issue.
41+
Help us to maximize the effort we can spend fixing issues and adding new
42+
features, by not reporting duplicate issues. Providing the following information will increase the
43+
chances of your issue being dealt with quickly:
44+
45+
* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
46+
* **Version** - what version is affected (e.g. 0.1.2)
47+
* **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you
48+
* **Browsers and Operating System** - is this a problem with all browsers?
49+
* **Reproduce the Error** - provide a live example or a unambiguous set of steps
50+
* **Related Issues** - has a similar issue been reported before?
51+
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
52+
causing the problem (line of code or commit)
53+
54+
You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/[organization-name]/[repository-name]/issues/new].
55+
56+
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
57+
Before you submit your Pull Request (PR) consider the following guidelines:
58+
59+
* Search the repository (https://github.com/[organization-name]/[repository-name]/pulls) for an open or closed PR
60+
that relates to your submission. You don't want to duplicate effort.
61+
62+
* Make your changes in a new git fork:
63+
64+
* Commit your changes using a descriptive commit message
65+
* Push your fork to GitHub:
66+
* In GitHub, create a pull request
67+
* If we suggest changes then:
68+
* Make the required updates.
69+
* Rebase your fork and force push to your GitHub repository (this will update your Pull Request):
70+
71+
```shell
72+
git rebase master -i
73+
git push -f
74+
```
75+
76+
That's it! Thank you for your contribution!

azure.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
2+
3+
name: remote-mcp-functions-python
4+
metadata:
5+
6+
services:
7+
api:
8+
project: ./src/
9+
language: python
10+
host: function

infra/abbreviations.json

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"analysisServicesServers": "as",
3+
"apiManagementService": "apim-",
4+
"appConfigurationConfigurationStores": "appcs-",
5+
"appManagedEnvironments": "cae-",
6+
"appContainerApps": "ca-",
7+
"authorizationPolicyDefinitions": "policy-",
8+
"automationAutomationAccounts": "aa-",
9+
"blueprintBlueprints": "bp-",
10+
"blueprintBlueprintsArtifacts": "bpa-",
11+
"cacheRedis": "redis-",
12+
"cdnProfiles": "cdnp-",
13+
"cdnProfilesEndpoints": "cdne-",
14+
"cognitiveServicesAccounts": "cog-",
15+
"cognitiveServicesFormRecognizer": "cog-fr-",
16+
"cognitiveServicesTextAnalytics": "cog-ta-",
17+
"computeAvailabilitySets": "avail-",
18+
"computeCloudServices": "cld-",
19+
"computeDiskEncryptionSets": "des",
20+
"computeDisks": "disk",
21+
"computeDisksOs": "osdisk",
22+
"computeGalleries": "gal",
23+
"computeSnapshots": "snap-",
24+
"computeVirtualMachines": "vm",
25+
"computeVirtualMachineScaleSets": "vmss-",
26+
"containerInstanceContainerGroups": "ci",
27+
"containerRegistryRegistries": "cr",
28+
"containerServiceManagedClusters": "aks-",
29+
"databricksWorkspaces": "dbw-",
30+
"dataFactoryFactories": "adf-",
31+
"dataLakeAnalyticsAccounts": "dla",
32+
"dataLakeStoreAccounts": "dls",
33+
"dataMigrationServices": "dms-",
34+
"dBforMySQLServers": "mysql-",
35+
"dBforPostgreSQLServers": "psql-",
36+
"devicesIotHubs": "iot-",
37+
"devicesProvisioningServices": "provs-",
38+
"devicesProvisioningServicesCertificates": "pcert-",
39+
"documentDBDatabaseAccounts": "cosmos-",
40+
"eventGridDomains": "evgd-",
41+
"eventGridDomainsTopics": "evgt-",
42+
"eventGridEventSubscriptions": "evgs-",
43+
"eventHubNamespaces": "evhns-",
44+
"eventHubNamespacesEventHubs": "evh-",
45+
"hdInsightClustersHadoop": "hadoop-",
46+
"hdInsightClustersHbase": "hbase-",
47+
"hdInsightClustersKafka": "kafka-",
48+
"hdInsightClustersMl": "mls-",
49+
"hdInsightClustersSpark": "spark-",
50+
"hdInsightClustersStorm": "storm-",
51+
"hybridComputeMachines": "arcs-",
52+
"insightsActionGroups": "ag-",
53+
"insightsComponents": "appi-",
54+
"keyVaultVaults": "kv-",
55+
"kubernetesConnectedClusters": "arck",
56+
"kustoClusters": "dec",
57+
"kustoClustersDatabases": "dedb",
58+
"logicIntegrationAccounts": "ia-",
59+
"logicWorkflows": "logic-",
60+
"machineLearningServicesWorkspaces": "mlw-",
61+
"managedIdentityUserAssignedIdentities": "id-",
62+
"managementManagementGroups": "mg-",
63+
"migrateAssessmentProjects": "migr-",
64+
"networkApplicationGateways": "agw-",
65+
"networkApplicationSecurityGroups": "asg-",
66+
"networkAzureFirewalls": "afw-",
67+
"networkBastionHosts": "bas-",
68+
"networkConnections": "con-",
69+
"networkDnsZones": "dnsz-",
70+
"networkExpressRouteCircuits": "erc-",
71+
"networkFirewallPolicies": "afwp-",
72+
"networkFirewallPoliciesWebApplication": "waf",
73+
"networkFirewallPoliciesRuleGroups": "wafrg",
74+
"networkFrontDoors": "fd-",
75+
"networkFrontdoorWebApplicationFirewallPolicies": "fdfp-",
76+
"networkLoadBalancersExternal": "lbe-",
77+
"networkLoadBalancersInternal": "lbi-",
78+
"networkLoadBalancersInboundNatRules": "rule-",
79+
"networkLocalNetworkGateways": "lgw-",
80+
"networkNatGateways": "ng-",
81+
"networkNetworkInterfaces": "nic-",
82+
"networkNetworkSecurityGroups": "nsg-",
83+
"networkNetworkSecurityGroupsSecurityRules": "nsgsr-",
84+
"networkNetworkWatchers": "nw-",
85+
"networkPrivateDnsZones": "pdnsz-",
86+
"networkPrivateLinkServices": "pl-",
87+
"networkPublicIPAddresses": "pip-",
88+
"networkPublicIPPrefixes": "ippre-",
89+
"networkRouteFilters": "rf-",
90+
"networkRouteTables": "rt-",
91+
"networkRouteTablesRoutes": "udr-",
92+
"networkTrafficManagerProfiles": "traf-",
93+
"networkVirtualNetworkGateways": "vgw-",
94+
"networkVirtualNetworks": "vnet-",
95+
"networkVirtualNetworksSubnets": "snet-",
96+
"networkVirtualNetworksVirtualNetworkPeerings": "peer-",
97+
"networkVirtualWans": "vwan-",
98+
"networkVpnGateways": "vpng-",
99+
"networkVpnGatewaysVpnConnections": "vcn-",
100+
"networkVpnGatewaysVpnSites": "vst-",
101+
"notificationHubsNamespaces": "ntfns-",
102+
"notificationHubsNamespacesNotificationHubs": "ntf-",
103+
"operationalInsightsWorkspaces": "log-",
104+
"portalDashboards": "dash-",
105+
"powerBIDedicatedCapacities": "pbi-",
106+
"purviewAccounts": "pview-",
107+
"recoveryServicesVaults": "rsv-",
108+
"resourcesResourceGroups": "rg-",
109+
"searchSearchServices": "srch-",
110+
"serviceBusNamespaces": "sb-",
111+
"serviceBusNamespacesQueues": "sbq-",
112+
"serviceBusNamespacesTopics": "sbt-",
113+
"serviceEndPointPolicies": "se-",
114+
"serviceFabricClusters": "sf-",
115+
"signalRServiceSignalR": "sigr",
116+
"sqlManagedInstances": "sqlmi-",
117+
"sqlServers": "sql-",
118+
"sqlServersDataWarehouse": "sqldw-",
119+
"sqlServersDatabases": "sqldb-",
120+
"sqlServersDatabasesStretch": "sqlstrdb-",
121+
"storageStorageAccounts": "st",
122+
"storageStorageAccountsVm": "stvm",
123+
"storSimpleManagers": "ssimp",
124+
"streamAnalyticsCluster": "asa-",
125+
"synapseWorkspaces": "syn",
126+
"synapseWorkspacesAnalyticsWorkspaces": "synw",
127+
"synapseWorkspacesSqlPoolsDedicated": "syndp",
128+
"synapseWorkspacesSqlPoolsSpark": "synsp",
129+
"timeSeriesInsightsEnvironments": "tsi-",
130+
"webServerFarms": "plan-",
131+
"webSitesAppService": "app-",
132+
"webSitesAppServiceEnvironment": "ase-",
133+
"webSitesFunctions": "func-",
134+
"webStaticSites": "stapp-"
135+
}

infra/app/api.bicep

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
param name string
2+
param location string = resourceGroup().location
3+
param tags object = {}
4+
param applicationInsightsName string = ''
5+
param appServicePlanId string
6+
param appSettings object = {}
7+
param runtimeName string
8+
param runtimeVersion string
9+
param serviceName string = 'api'
10+
param storageAccountName string
11+
param deploymentStorageContainerName string
12+
param virtualNetworkSubnetId string = ''
13+
param instanceMemoryMB int = 2048
14+
param maximumInstanceCount int = 100
15+
param identityId string = ''
16+
param identityClientId string = ''
17+
18+
var applicationInsightsIdentity = 'ClientId=${identityClientId};Authorization=AAD'
19+
20+
module api '../core/host/functions-flexconsumption.bicep' = {
21+
name: '${serviceName}-functions-module'
22+
params: {
23+
name: name
24+
location: location
25+
tags: union(tags, { 'azd-service-name': serviceName })
26+
identityType: 'UserAssigned'
27+
identityId: identityId
28+
appSettings: union(appSettings,
29+
{
30+
AzureWebJobsStorage__clientId : identityClientId
31+
APPLICATIONINSIGHTS_AUTHENTICATION_STRING: applicationInsightsIdentity
32+
})
33+
applicationInsightsName: applicationInsightsName
34+
appServicePlanId: appServicePlanId
35+
runtimeName: runtimeName
36+
runtimeVersion: runtimeVersion
37+
storageAccountName: storageAccountName
38+
deploymentStorageContainerName: deploymentStorageContainerName
39+
virtualNetworkSubnetId: virtualNetworkSubnetId
40+
instanceMemoryMB: instanceMemoryMB
41+
maximumInstanceCount: maximumInstanceCount
42+
}
43+
}
44+
45+
output SERVICE_API_NAME string = api.outputs.name
46+
output SERVICE_API_IDENTITY_PRINCIPAL_ID string = api.outputs.identityPrincipalId

infra/app/storage-Access.bicep

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
param principalID string
2+
param roleDefinitionID string
3+
param storageAccountName string
4+
5+
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
6+
name: storageAccountName
7+
}
8+
9+
// Allow access from API to storage account using a managed identity and least priv Storage roles
10+
resource storageRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
11+
name: guid(storageAccount.id, principalID, roleDefinitionID)
12+
scope: storageAccount
13+
properties: {
14+
roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID)
15+
principalId: principalID
16+
principalType: 'ServicePrincipal' // Workaround for https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal
17+
}
18+
}
19+
20+
output ROLE_ASSIGNMENT_NAME string = storageRoleAssignment.name
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
// Parameters
2+
@description('Specifies the name of the virtual network.')
3+
param virtualNetworkName string
4+
5+
@description('Specifies the name of the subnet which contains the virtual machine.')
6+
param subnetName string
7+
8+
@description('Specifies the resource name of the Storage resource with an endpoint.')
9+
param resourceName string
10+
11+
@description('Specifies the location.')
12+
param location string = resourceGroup().location
13+
14+
param tags object = {}
15+
16+
// Virtual Network
17+
resource vnet 'Microsoft.Network/virtualNetworks@2021-08-01' existing = {
18+
name: virtualNetworkName
19+
}
20+
21+
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
22+
name: resourceName
23+
}
24+
25+
var blobPrivateDNSZoneName = format('privatelink.blob.{0}', environment().suffixes.storage)
26+
var blobPrivateDnsZoneVirtualNetworkLinkName = format('{0}-link-{1}', resourceName, take(toLower(uniqueString(resourceName, virtualNetworkName)), 4))
27+
28+
// Private DNS Zones
29+
resource blobPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' = {
30+
name: blobPrivateDNSZoneName
31+
location: 'global'
32+
tags: tags
33+
properties: {}
34+
dependsOn: [
35+
vnet
36+
]
37+
}
38+
39+
// Virtual Network Links
40+
resource blobPrivateDnsZoneVirtualNetworkLink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2020-06-01' = {
41+
parent: blobPrivateDnsZone
42+
name: blobPrivateDnsZoneVirtualNetworkLinkName
43+
location: 'global'
44+
tags: tags
45+
properties: {
46+
registrationEnabled: false
47+
virtualNetwork: {
48+
id: vnet.id
49+
}
50+
}
51+
}
52+
53+
// Private Endpoints
54+
resource blobPrivateEndpoint 'Microsoft.Network/privateEndpoints@2021-08-01' = {
55+
name: 'blob-private-endpoint'
56+
location: location
57+
tags: tags
58+
properties: {
59+
privateLinkServiceConnections: [
60+
{
61+
name: 'blobPrivateLinkConnection'
62+
properties: {
63+
privateLinkServiceId: storageAccount.id
64+
groupIds: [
65+
'blob'
66+
]
67+
}
68+
}
69+
]
70+
subnet: {
71+
id: '${vnet.id}/subnets/${subnetName}'
72+
}
73+
}
74+
}
75+
76+
resource blobPrivateDnsZoneGroupName 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2022-01-01' = {
77+
parent: blobPrivateEndpoint
78+
name: 'blobPrivateDnsZoneGroup'
79+
properties: {
80+
privateDnsZoneConfigs: [
81+
{
82+
name: 'storageBlobARecord'
83+
properties: {
84+
privateDnsZoneId: blobPrivateDnsZone.id
85+
}
86+
}
87+
]
88+
}
89+
}

0 commit comments

Comments
 (0)