This commit is contained in:
David Starr 2023-04-21 10:33:16 -07:00
Родитель 7cfd4d67d5
Коммит 53683376e9
2 изменённых файлов: 94 добавлений и 82 удалений

Просмотреть файл

@ -1,38 +1,45 @@
# Azure Application: HOW-TO Deploy Container Offer with AKS
This repo demonestrate how to deploy Container offer as part of AKS cluster as Azure Managed Application.
This repo demonstrates how to deploy Container offer as part of AKS cluster as Azure Managed Application.
## How To Deploy AKS as Azure Application
Please refer to the following repo for detail about how create Managed Application ARM template to deploy AKS
[Azure Managed Application and AKS with Managed Identity](https://github.com/arsenvlad/azure-managed-app-aks-managed-identity)
## Challenges to deploy Container Offer as part of the ARM template
Please refer to the following repo for details creating Azure Managed Application (AMA) ARM templates to deploy AKS in the AMA managed resource group.
In order to deploy Container Offer as Part of the Managed App. The following information must be provided as part of the ARM chart.
> [Azure Managed Application and AKS with Managed Identity](https://github.com/arsenvlad/azure-managed-app-aks-managed-identity)
```
"clusterExtensionTypeName": " Enter the Extension Type",
"plan-name": "Enter the Plan Name",
"plan-offerID": " Enter Offer ID",
"plan-publisher": "Enter the publisher ID",
"releaseTrain": "stable"
```
## Challenges to deploy Container Offer as part of the ARM template
Here is example for AzureVote Demo information
```
"clusterExtensionTypeName": "Contoso.AzureVoteKubernetesAppTest",
"plan-name": "testplan",
"plan-offerID": "kubernetest_apps_demo_offer",
"plan-publisher": "test_test_mix3pptest0011614206850774",
"releaseTrain": "stable"
In order to deploy Container Offer as Part of the Managed App. The following information must be provided as part of the ARM chart.
```json
"clusterExtensionTypeName": " Enter the Extension Type",
"plan-name": "Enter the Plan Name",
"plan-offerID": " Enter Offer ID",
"plan-publisher": "Enter the publisher ID",
"releaseTrain": "stable"
```
Here is example for AzureVote Demo information.
```json
"clusterExtensionTypeName": "Contoso.AzureVoteKubernetesAppTest",
"plan-name": "testplan",
"plan-offerID": "kubernetest_apps_demo_offer",
"plan-publisher": "test_test_mix3pptest0011614206850774",
"releaseTrain": "stable"
```
## Azure Application Offer Resources
You can learn more about Azure Managed Application offer using the following resources
1. [Mastering The Marketplace](https://microsoft.github.io/Mastering-the-Marketplace/ama/)
1. [Azure Managed Applications overview](https://learn.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/overview)
You can learn more about Azure Managed Application offers using the following resources.
1. [Mastering The Marketplace](https://microsoft.github.io/Mastering-the-Marketplace/ama/) on-demand video course.
1. [Azure Managed Applications overview](https://learn.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/overview) documentation.
## Azure Container Offer Resources
You can learn more about Azure Container offer using the following resources
1. [Mastering The Marketplace](https://microsoft.github.io/Mastering-the-Marketplace/container/)
1. [Azure Container Offer overview](https://learn.microsoft.com/en-us/azure/marketplace/marketplace-containers)
You can learn more about Azure Container offer using the following resources.
1. [Mastering The Marketplace](https://microsoft.github.io/Mastering-the-Marketplace/container/) on-demand video course.
1. [Azure Container Offer overview](https://learn.microsoft.com/en-us/azure/marketplace/marketplace-containers) documentation.

Просмотреть файл

@ -5,75 +5,80 @@ This is a simple demo for Azure OCR scanning function with Landing page capabili
This code exists to show exercising the client library used.
## Demo Diagram
![SaaS Metered](./images/Diagram.png)
The demo consist of the following componets
The demo consist of the following components.
1. Azure Web App: To demo Azure OCR scanning function and Landing code
2. Azure CosmosDB: To store OCR transcations in database
2. Azure CosmosDB: To store OCR transactions in database
3. Azure Function: TO emit metered data to Azure Marketplace
## Prerequisites
1. [Create Azure Compute Vision Account](https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/quickstarts-sdk/client-library?tabs=visual-studio&pivots=programming-language-csharp)
2. [Create Azure CosmosDB](https://docs.microsoft.com/en-us/azure/cosmos-db/introduction)
## Running Locally
Before running the application locally the following configuration should be in place.
1. MeteredPage: update the appsettings.json with the following configuration for ApplicationID and Secrets, Cosmosdb configuration and Azure OCR configuration
```
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "YOUR_DOMAIN",
"TenantId": "TENANT_ID",
"ClientId": "CLIENT_ID",
"ClientSecret": "CLIENT_SECRET",
"CallbackPath": "/signin-oidc",
"SignedOutCallbackPath ": "/signout-callback-oidc"
},
"MarketplaceApi": {
"ClientId": "CLIENT_ID",
"ClientSecret": "CLIENT_SECRET",
"TenantId": "YOUR_TENANT_ID"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"subscriptionKey": "AZURE_OCR_SUB_KEY",
"ocrEndPoint": "AZURE_OCR_END_POINT_URI",
"CosmosDb": {
"Account": "AZURE_COSMOSDB_ACCOUNT_END_POINT_URI",
"Key": "AZURE_COSMOSDB_ACCOUNT_KEY",
"DatabaseName": "AZURE_COSMOSDB_DATABASE",
"ContainerName": "AZURE_COSMOSDB_CONTAINER"
}
}
```
2. AzureFunction:
Before running the application locally the following configuration should be in place.
1. MeteredPage: update the `appsettings.json` with the following configuration for ApplicationID and Secrets, Cosmosdb configuration and Azure OCR configuration.
```json
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "YOUR_DOMAIN",
"TenantId": "TENANT_ID",
"ClientId": "CLIENT_ID",
"ClientSecret": "CLIENT_SECRET",
"CallbackPath": "/signin-oidc",
"SignedOutCallbackPath ": "/signout-callback-oidc"
},
"MarketplaceApi": {
"ClientId": "CLIENT_ID",
"ClientSecret": "CLIENT_SECRET",
"TenantId": "YOUR_TENANT_ID"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"subscriptionKey": "AZURE_OCR_SUB_KEY",
"ocrEndPoint": "AZURE_OCR_END_POINT_URI",
"CosmosDb": {
"Account": "AZURE_COSMOSDB_ACCOUNT_END_POINT_URI",
"Key": "AZURE_COSMOSDB_ACCOUNT_KEY",
"DatabaseName": "AZURE_COSMOSDB_DATABASE",
"ContainerName": "AZURE_COSMOSDB_CONTAINER"
}
}
```
2. AzureFunction
- Rename local.settings-RenameMe.json to local.settings.json
- Update the file with the following configuration
```
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"CosmosDb_Key": "AZURE_COSMOSDB_ACCOUNT_KEY",
"CosmosDb_Uri": "AZURE_COSMOSDB_ACCOUNT_END_POINT_URI",
"CosmosDb_Database": "AZURE_COSMOSDB_DATABASE",
"CosmosDb_Collection": "AZURE_COSMOSDB_CONTAINER",
"TenantId": "TENANT_ID",
"ClientId": "CLIENT_ID",
"ClientSecret": "CLIENT_SECRET",
"Scope": "20e940b3-4c77-4b0b-9a53-9e16a1b010a7/.default"
}
```
```json
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"CosmosDb_Key": "AZURE_COSMOSDB_ACCOUNT_KEY",
"CosmosDb_Uri": "AZURE_COSMOSDB_ACCOUNT_END_POINT_URI",
"CosmosDb_Database": "AZURE_COSMOSDB_DATABASE",
"CosmosDb_Collection": "AZURE_COSMOSDB_CONTAINER",
"TenantId": "TENANT_ID",
"ClientId": "CLIENT_ID",
"ClientSecret": "CLIENT_SECRET",
"Scope": "20e940b3-4c77-4b0b-9a53-9e16a1b010a7/.default"
}
```