Coder Social home page Coder Social logo

microsoftdocs / mslearn-aspnet-core Goto Github PK

View Code? Open in Web Editor NEW
90.0 17.0 129.0 8.05 MB

Sample apps for Microsoft Learn modules using ASP.NET Core.

License: MIT License

Shell 1.54% C# 48.57% HTML 3.00% CSS 1.38% JavaScript 37.77% Dockerfile 1.88% TypeScript 4.24% SCSS 1.62%

mslearn-aspnet-core's Introduction

mslearn-aspnet-core's People

Contributors

camsoper avatar devlead avatar ecortijo avatar erjain avatar galmond avatar microsoftopensource avatar msftgits avatar nishanil avatar scottaddie avatar vaishaliraval avatar vnbaaij avatar wadepickett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mslearn-aspnet-core's Issues

Error in script

When I run setup script from this page, it doesn't create the webapp or resource group right.

https://docs.microsoft.com/en-us/learn/modules/create-razor-pages-aspnet-core/4-run-razor-pages-project

Here's the output with my Azure username redacted:
---------------------------------------------------------------

Hi there!
I'm going to provision some Azure resources
and get the code you'll need for this module.


Downloading code...
++ wget -q -O - https://raw.githubusercontent.com/MicrosoftDocs/mslearn-aspnet-core/live/infrastructure/scripts/sparsecheckout.sh
++ bash -s modules/create-razor-pages-aspnet-core/setup/ modules/create-razor-pages-aspnet-core/src/
Updating origin
remote: Enumerating objects: 1974, done.
remote: Total 1974 (delta 0), reused 0 (delta 0), pack-reused 1974
Receiving objects: 100% (1974/1974), 1.53 MiB | 0 bytes/s, done.
Resolving deltas: 100% (1009/1009), done.
From https://github.com/MicrosoftDocs/mslearn-aspnet-core
 * [new branch]      identity-3.0 -> origin/identity-3.0
 * [new branch]      live       -> origin/live
 * [new branch]      master     -> origin/master
~/contoso-pets/modules/create-razor-pages-aspnet-core/setup ~/contoso-pets
~/contoso-pets

Setting default Azure CLI values...
++ az configure --defaults group=learn-709de7c2-d629-4c42-b203-e3507244dd46 location=westus

Provisioning App Service Plan...
+++ az appservice plan create --name plan121720886 --sku F1 --output none
**The scale operation is not allowed for this subscription in this region. Try selecting different regionor scale option.**

Provisioning ContosoPets.Api API Web App...
+++ az webapp create --name apiapp121720886 --plan plan121720886 --output none
Provisioning ContosoPets.Ui Web App Web App...
+++ az webapp create --name webapp121720886 --plan plan121720886 --output none
usage: az webapp create [-h] [--verbose] [--debug]
                        [--output {json,jsonc,table,tsv,yaml,none}]
                        [--query JMESPATH] [--subscription _SUBSCRIPTION]
                        [--resource-group RESOURCE_GROUP_NAME] --name NAME
                        --plan PLAN [--runtime RUNTIME]
                        [--startup-file STARTUP_FILE]
                        [--deployment-container-image-name DEPLOYMENT_CONTAINER_IMAGE_NAME]
                        [--deployment-source-url DEPLOYMENT_SOURCE_URL]
                        [--deployment-source-branch DEPLOYMENT_SOURCE_BRANCH]
                        [--deployment-local-git]
                        [--docker-registry-server-password DOCKER_REGISTRY_SERVER_PASSWORD]
                        [--docker-registry-server-user DOCKER_REGISTRY_SERVER_USER]
                        [--multicontainer-config-type {COMPOSE,KUBE}]
                        [--multicontainer-config-file MULTICONTAINER_CONFIG_FILE]
                        [--tags [TAGS [TAGS ...]]]
**az webapp create: error: 'NoneType' object has no attribute 'location'**
usage: az webapp create [-h] [--verbose] [--debug]
                        [--output {json,jsonc,table,tsv,yaml,none}]
                        [--query JMESPATH] [--subscription _SUBSCRIPTION]
                        [--resource-group RESOURCE_GROUP_NAME] --name NAME
                        --plan PLAN [--runtime RUNTIME]
                        [--startup-file STARTUP_FILE]
                        [--deployment-container-image-name DEPLOYMENT_CONTAINER_IMAGE_NAME]
                        [--deployment-source-url DEPLOYMENT_SOURCE_URL]
                        [--deployment-source-branch DEPLOYMENT_SOURCE_BRANCH]
                        [--deployment-local-git]
                        [--docker-registry-server-password DOCKER_REGISTRY_SERVER_PASSWORD]
                        [--docker-registry-server-user DOCKER_REGISTRY_SERVER_USER]
                        [--multicontainer-config-type {COMPOSE,KUBE}]
                        [--multicontainer-config-file MULTICONTAINER_CONFIG_FILE]
                        [--tags [TAGS [TAGS ...]]]
**az webapp create: error: 'NoneType' object has no attribute 'location'**

Configuring ContosoPets.Ui Web App Web App...
+++ az webapp config appsettings set --name webapp121720886 --settings SCM_DO_BUILD_DURING_DEPLOYMENT=True --output none

Configuring ContosoPets.Api API Web App...
+++ az webapp config appsettings set --name apiapp121720886 --settings SCM_DO_BUILD_DURING_DEPLOYMENT=True --output none
****ResourceNotFound - The Resource 'Microsoft.Web/sites/apiapp121720886' under resource group 'learn-709de7c2-d629-4c42-b203-e3507244dd46' was not found.
ResourceNotFound - The Resource 'Microsoft.Web/sites/webapp121720886' under resource group 'learn-709de7c2-d629-4c42-b203-e3507244dd46' was not found.**
~/contoso-pets/src/ContosoPets.Ui/.azure ~/contoso-pets/src/ContosoPets.Ui**

Your environment is ready!
I set up some Azure resources and downloaded the code you'll need.
You can resume this session and display this message again by re-running the script.

The following variable is used in this module:
webAppUrl: https://webapp121720886.azurewebsites.net

XXXXXXX@Azure:~/contoso-pets/src/ContosoPets.Ui$ az webapp show
**{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Web/sites/webapp121720886' underresource group 'learn-709de7c2-d629-4c42-b203-e3507244dd46' was not found."}}**

file not found error while building Coupon.API service for first time

I am following this tutorial from Microsoft Learn - Create and deploy a cloud-native ASP.NET Core microservice. I am getting the below shown error when trying to build the Coupon.API service for the first time:
image

As you can see, the .csproj file exists in the correct folder. I am using GitHub codespace as recommended in the course. Please let me know how can I resolve this Issue?

Getting No such file or directory error while executing quickstart script

../mslearn-aspnet-core/modules/microservices-aspnet-core/deploy/k8s % ./quickstart.sh
Using the default location: eastus
Using the default resource group: eshop-learn-rg
Note: You can change the default location and resource group by modifying the variables at the top of quickstart.sh.
cat: ../../create-aks-exports.txt: No such file or directory
cat: ../../deployment-urls.txt: No such file or directory

Error during run. Key vault has mandatory parameter now.

infrastructure/scripts/provisioning/keyvault.sh

--enable-soft-delete is required now or the creation will fail. There was a doc earlier on that was also broken because of this, but i could modify it easy (just copy and paste command stuff). Now I am going to try and set a default for this so the script runs and I can finish training for my exam.

https://docs.microsoft.com/en-ca/learn/modules/secure-aspnet-core-identity/2-setup-environment?pivots=sql

Set up dev environment.

Error while running the script

Hello,

Can we please have a tutorial to set up all the things that "https://aka.ms/microservices-logging-aspnet-core-setup" script does? I didn't find any discussion page and so I posted my question here.

Whenever I run the script, I keep running into this issue:
error: You must be logged in to the server (the server has asked for the client to provide credentials

Then, I have to stop the script from the endless retries. Thank you.

QuotaExceeded error

I saw no mention of this in existing issues or searching online (perhaps specific to my environment/subscription?)

I went through the learn module and after "Install the app", step 5 ("Run the quickstart script"), I see the following in the terminal...

> az aks create -n eshop-learn-aks -g test-eshop -c 1 --node-vm-size Standard_D4_v5 --vm-set-type VirtualMachineScaleSets -l westus --enable-managed-identity --generate-ssh-keys -o json

ERROR: (QuotaExceeded) Provisioning of resource(s) for container service eshop-learn-aks... failed. Message: Operation could not be completed as it results in exceeding approved standardDv5Family Cores quota. Additional details - Deployment Model: Resource Manager, Location: westus, Current Limit: 0, Current Usage: 0, Additional Required: 4, (Minimum) New Limit Required: 4. Submit a request for Quota increase at {snipped} by specifying parameters listed in the ‘Details’ section for deployment to succeed. Please read more about quota limits at https://docs.microsoft.com/en-us/azure/azure-supportability/per-vm-quota-requests. 
Code: QuotaExceeded

My Quotas shows at most 2/10 used. The default vm template (Standard_D2_v5) only requests 2 vpus, I tried a 4 vcpu vm with same results (copied above). I tried provisioning to westus too (in the event that the vm just wasn't available in that region somehow)

Waiting for Load Balancer IP

The script doesn't complete as it is never able to obtain the load balancer IP. The command below returns no IP addresses:

az network public-ip list --debug -g MC_eshop-learn-rg_eshop-learn-aks_westus

Debug output follows:

DEBUG: Command arguments: ['network', 'public-ip', 'list', '--debug', '-g', 'MC_eshop-learn-rg_eshop-learn-aks_westus', '--query', "[?tags.service=='ingress-nginx/ingress-nginx'].ipAddress", '-otsv']
DEBUG: Event: Cli.PreExecute []
DEBUG: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f3bcb4b6940>, <function OutputProducer.on_global_arguments at 0x7f3bcb484670>, <function CLIQuery.on_global_arguments at 0x7f3bcb4148b0>]
DEBUG: Event: CommandInvoker.OnPreCommandTableCreate []
DEBUG: Installed command modules ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'deploymentmanager', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'managedservices', 'maps', 'monitor', 'natgateway', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'vm']
DEBUG: Loaded module 'acr' in 0.003 seconds.
DEBUG: Loaded module 'acs' in 0.004 seconds.
DEBUG: Loaded module 'advisor' in 0.001 seconds.
DEBUG: Event: CommandLoader.OnLoadCommandTable []
DEBUG: Loaded module 'ams' in 0.003 seconds.
DEBUG: Loaded module 'apim' in 0.001 seconds.
DEBUG: Loaded module 'appconfig' in 0.001 seconds.
DEBUG: Loaded module 'appservice' in 0.005 seconds.
DEBUG: Loaded module 'backup' in 0.010 seconds.
DEBUG: Event: CommandLoader.OnLoadCommandTable []
DEBUG: Loaded module 'batch' in 0.005 seconds.
DEBUG: Loaded module 'batchai' in 0.002 seconds.
DEBUG: Loaded module 'billing' in 0.001 seconds.
DEBUG: Loaded module 'botservice' in 0.002 seconds.
DEBUG: Event: CommandLoader.OnLoadCommandTable []
DEBUG: Loaded module 'cdn' in 0.002 seconds.
DEBUG: Loaded module 'cloud' in 0.001 seconds.
DEBUG: Loaded module 'cognitiveservices' in 0.001 seconds.
DEBUG: Loaded module 'configure' in 0.001 seconds.
DEBUG: Loaded module 'consumption' in 0.001 seconds.
DEBUG: Loaded module 'container' in 0.001 seconds.
DEBUG: Loaded module 'cosmosdb' in 0.005 seconds.
DEBUG: Loaded module 'deploymentmanager' in 0.002 seconds.
DEBUG: Loaded module 'dla' in 0.002 seconds.
DEBUG: Loaded module 'dls' in 0.001 seconds.
DEBUG: Loaded module 'dms' in 0.001 seconds.
DEBUG: Loaded module 'eventgrid' in 0.001 seconds.
DEBUG: Loaded module 'eventhubs' in 0.002 seconds.
DEBUG: Loaded module 'extension' in 0.000 seconds.
DEBUG: Loaded module 'feedback' in 0.000 seconds.
DEBUG: Loaded module 'find' in 0.000 seconds.
DEBUG: Loaded module 'hdinsight' in 0.001 seconds.
DEBUG: Loaded module 'interactive' in 0.000 seconds.
DEBUG: Loaded module 'iot' in 0.002 seconds.
DEBUG: Loaded module 'iotcentral' in 0.001 seconds.
DEBUG: Loaded module 'keyvault' in 0.002 seconds.
DEBUG: Loaded module 'kusto' in 0.001 seconds.
DEBUG: Loaded module 'lab' in 0.001 seconds.
DEBUG: Loaded module 'managedservices' in 0.001 seconds.
DEBUG: Loaded module 'maps' in 0.001 seconds.
DEBUG: Loaded module 'monitor' in 0.002 seconds.
DEBUG: Loaded module 'natgateway' in 0.001 seconds.
DEBUG: Event: CommandLoader.OnLoadCommandTable []
DEBUG: Loaded module 'netappfiles' in 0.001 seconds.
DEBUG: Loaded module 'network' in 0.015 seconds.
DEBUG: Loaded module 'policyinsights' in 0.001 seconds.
DEBUG: Loaded module 'privatedns' in 0.002 seconds.
DEBUG: Loaded module 'profile' in 0.001 seconds.
DEBUG: Loaded module 'rdbms' in 0.003 seconds.
DEBUG: Loaded module 'redis' in 0.001 seconds.
DEBUG: Loaded module 'relay' in 0.001 seconds.
DEBUG: Loaded module 'reservations' in 0.001 seconds.
DEBUG: Loaded module 'resource' in 0.003 seconds.
DEBUG: Loaded module 'role' in 0.002 seconds.
DEBUG: Loaded module 'search' in 0.001 seconds.
DEBUG: Loaded module 'security' in 0.001 seconds.
DEBUG: Loaded module 'servicebus' in 0.002 seconds.
DEBUG: Loaded module 'servicefabric' in 0.001 seconds.
DEBUG: Loaded module 'signalr' in 0.001 seconds.
DEBUG: Loaded module 'sql' in 0.004 seconds.
DEBUG: Loaded module 'sqlvm' in 0.001 seconds.
DEBUG: Event: CommandLoader.OnLoadCommandTable []
DEBUG: Loaded module 'storage' in 0.014 seconds.
DEBUG: Loaded module 'vm' in 0.008 seconds.
DEBUG: Loaded all modules in 0.138 seconds. (note: there's always an overhead with the first module loaded)
DEBUG: Extensions directory: '/home/[email protected]/.azure/cliextensions'
DEBUG: Found 1 extensions: ['azure-devops']
DEBUG: Extensions directory: '/home/[email protected]/.azure/cliextensions'
DEBUG: Extension compatibility result: is_compatible=True cli_core_version=2.0.81 min_required=2.0.69 max_required=None
DEBUG: Extensions directory: '/home/[email protected]/.azure/cliextensions'
DEBUG: Loaded extension 'azure-devops' in 0.010 seconds.
DEBUG: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f3bcae7dd30>]
INFO: az_command_data_logger : command args: network public-ip list --debug -g {} --query {} -o{}
DEBUG: metadata file logging enabled - writing logs to '/home/[email protected]/.azure/commands'.
DEBUG: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7f3bcae1adc0>]
DEBUG: Event: CommandInvoker.OnPostArgumentLoad []
DEBUG: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7f3bcae51160>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7f3bcae51280>]
DEBUG: Event: CommandInvoker.OnCommandTableLoaded []
DEBUG: Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x7f3bca13f670>]
DEBUG: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f3bcb484700>, <function CLIQuery.handle_query_parameter at 0x7f3bcb414940>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7f3bcae511f0>, <function handler at 0x7f3bc9ffc550>, <function DevCommandsLoader.post_parse_args at 0x7f3bc97ecf70>]
DEBUG: Getting management service client client_type=NetworkManagementClient
DEBUG: msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
DEBUG: msrest.async_paging : Paging async iterator protocol is not available for PublicIPAddressPaged
DEBUG: attempting to read file /home/[email protected]/.azure/accessTokens.json as utf-8-sig
DEBUG: adal-python : e16e7c87-14c6-4b54-beb1-7b907fe90b60 - Authority:Performing instance discovery: ...
DEBUG: adal-python : e16e7c87-14c6-4b54-beb1-7b907fe90b60 - Authority:Performing static instance discovery
DEBUG: adal-python : e16e7c87-14c6-4b54-beb1-7b907fe90b60 - Authority:Authority validated via static instance discovery
DEBUG: adal-python : e16e7c87-14c6-4b54-beb1-7b907fe90b60 - TokenRequest:Getting token from cache with refresh if necessary.
DEBUG: adal-python : e16e7c87-14c6-4b54-beb1-7b907fe90b60 - CacheDriver:finding with query keys: {'_clientId': '...', 'userId': '...'}
DEBUG: adal-python : e16e7c87-14c6-4b54-beb1-7b907fe90b60 - CacheDriver:Looking for potential cache entries: {'_clientId': '...', 'userId': '...'}
DEBUG: adal-python : e16e7c87-14c6-4b54-beb1-7b907fe90b60 - CacheDriver:Found 3 potential entries.
DEBUG: adal-python : e16e7c87-14c6-4b54-beb1-7b907fe90b60 - CacheDriver:Resource specific token found.
DEBUG: adal-python : e16e7c87-14c6-4b54-beb1-7b907fe90b60 - CacheDriver:Returning token from cache lookup, AccessTokenId: b'eu1GaHezIxv/gp7KccdUVUOiHsUOgLokbPRn/tTvb08=', RefreshTokenId: b'dWH9LBcRZ8e+pfps62IwahieOeuAhuQBfQJ7OpZhATU='
DEBUG: msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/3a63d27c-9737-454f-89cd-7d77bbe55968/resourceGroups/MC_eshop-learn-rg_eshop-learn-aks_westus/providers/Microsoft.Network/publicIPAddresses?api-version=2019-09-01'
DEBUG: msrest.http_logger : Request method: 'GET'
DEBUG: msrest.http_logger : Request headers:
DEBUG: msrest.http_logger :     'Accept': 'application/json'
DEBUG: msrest.http_logger :     'accept-language': 'en-US'
DEBUG: msrest.http_logger :     'User-Agent': 'python/3.8.10 (Linux-5.11.0-40-generic-x86_64-with-glibc2.29) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81'
DEBUG: msrest.http_logger : Request body:
DEBUG: msrest.http_logger : None
DEBUG: msrest.universal_http : Configuring redirects: allow=True, max=30
DEBUG: msrest.universal_http : Configuring request: timeout=100, verify=True, cert=None
DEBUG: msrest.universal_http : Configuring proxies: ''
DEBUG: msrest.universal_http : Evaluate proxies against ENV settings: True
DEBUG: urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com:443
DEBUG: urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/3a63d27c-9737-454f-89cd-7d77bbe55968/resourceGroups/MC_eshop-learn-rg_eshop-learn-aks_westus/providers/Microsoft.Network/publicIPAddresses?api-version=2019-09-01 HTTP/1.1" 200 133
DEBUG: msrest.http_logger : Response status: 200
DEBUG: msrest.http_logger : Response headers:
DEBUG: msrest.http_logger :     'Cache-Control': 'no-cache'
DEBUG: msrest.http_logger :     'Pragma': 'no-cache'
DEBUG: msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
DEBUG: msrest.http_logger :     'Content-Encoding': 'gzip'
DEBUG: msrest.http_logger :     'Expires': '-1'
DEBUG: msrest.http_logger :     'Vary': 'Accept-Encoding'
DEBUG: msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '11999'
DEBUG: msrest.http_logger :     'x-ms-request-id': '307c6272-1697-4a5d-ab4a-62499150fe50'
DEBUG: msrest.http_logger :     'x-ms-correlation-request-id': '307c6272-1697-4a5d-ab4a-62499150fe50'
DEBUG: msrest.http_logger :     'x-ms-routing-request-id': 'WESTUS2:20211112T015828Z:307c6272-1697-4a5d-ab4a-62499150fe50'
DEBUG: msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
DEBUG: msrest.http_logger :     'X-Content-Type-Options': 'nosniff'
DEBUG: msrest.http_logger :     'Date': 'Fri, 12 Nov 2021 01:58:28 GMT'
DEBUG: msrest.http_logger :     'Content-Length': '133'
DEBUG: msrest.http_logger : Response content:
DEBUG: msrest.http_logger : {"value":[]}
DEBUG: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x7f3bcae49040>, <function _x509_from_base64_to_hex_transform at 0x7f3bcae490d0>]
DEBUG: Event: CommandInvoker.OnFilterResult [<function CLIQuery.handle_query_parameter.<locals>.filter_output at 0x7f3bc9655ee0>]
DEBUG: Event: Cli.PostExecute []
INFO: az_command_data_logger : exit code: 0
INFO: telemetry.save : Save telemetry record of length 2512 in cache
WARNING: telemetry.check : Negative: The /home/[email protected]/.azure/telemetry.txt was modified at 2021-11-11 18:55:42.405934, which in less than 600.000000 s
INFO: command ran in 0.470 seconds.

Missing file: create-acr-exports.txt under microservices-loggin-aspnet-core directory

Following the Exercise in the Unit 4 for Instrument a cloud-native ASP.NET Core Microservice, the section for Build and deploy modified container images contains the instruction at Step "2. Run this script to build the images for the catalog service and HTTP aggregator:" . The build-to-acr.sh file checks for the create-acr-exports.txt file in the first if code block and fails with the following error,

One or more required environment variables are missing:

  • ESHOP_REGISTRY.:
  • ESHOP_ACRNAME..:

This is caused due to the file missing at the intended location.
Creating a copy of this file from the resiliency folder at the location allows the image build to complete successfully.

Seperate provisioning of Azure ressources from tooling installation

In /infrastructure/scripts/initenvironment.sh you mix provisioning of Azure resources with tooling installation (ie .net 3.1 sdk, cli, ...) . I think it would be cleaner to separate this two tasks. By doing so it would be easier for students to re-use parts of your scripts as a starting point for their own deployments

Error getting credentials for AKS

When I run the following command:

. <(wget -q -O - https://aka.ms/microservices-aspnet-core-setup)

As exemplified on the MS Docs, I get the following error on Cloud Shell:

AKS cluster created.

Getting credentials for AKS...
(ResourceNotFound) The Resource 'Microsoft.ContainerService/managedClusters/eshop-learn-aks' under resource group 'eshop-learn-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.ContainerService/managedClusters/eshop-learn-aks' under resource group 'eshop-learn-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

Installing NGINX ingress controller
error: You must be logged in to the server (the server has asked for the client to provide credentials)
error: You must be logged in to the server (the server has asked for the client to provide credentials)
error: You must be logged in to the server (the server has asked for the client to provide credentials)

"Resiliency" module / Implement code-based resiliency - JsonSerializationException instead of "The circuit is now open..." message

While doing the fifth step of the "resiliency" module https://learn.microsoft.com/en-us/training/modules/microservices-resiliency-aspnet-core/5-implement-polly-resiliency when testing the "Circuit Breaker policy", I got a Newtonsoft.Json.JsonSerializationException: Self referencing loop detected with type 'System.Text.RegularExpressions.Group'. Path 'captures'. instead of the expected "The circuit is now open..." message.

This is basically the last step of the linked page. Here are my screenshots from Seq, compare it with the one at the bottom of that step in the learn module:

image

image

Full json exception info:

{"@t":"2022-09-17T17:36:13.4987565Z","@mt":"An unhandled exception has occurred while executing the request.","@m":"An unhandled exception has occurred while executing the request.","@i":"bd577466","@l":"Error","@x":"Newtonsoft.Json.JsonSerializationException: Self referencing loop detected with type 'System.Text.RegularExpressions.Group'. Path 'captures'.\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CheckForCircularReference(JsonWriter writer, Object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\n   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\n   at Newtonsoft.Json.JsonSerializer.Serialize(JsonWriter jsonWriter, Object value)\n   at Microsoft.AspNetCore.Mvc.Formatters.NewtonsoftJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)\n   at Microsoft.AspNetCore.Mvc.Formatters.NewtonsoftJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)\n   at Microsoft.AspNetCore.Mvc.Formatters.NewtonsoftJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()\n--- End of stack trace from previous location ---\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)\n   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)\n   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\n   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)\n   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)\n   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)","EventId":{"Id":1,"Name":"UnhandledException"},"SourceContext":"Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware","RequestId":"0HMKOQASG6LEH:00000003","RequestPath":"/webshoppingagg/api/v1/coupon/DISC-10","ConnectionId":"0HMKOQASG6LEH","ApplicationContext":"WebAggregator"}

WebSPA build fails with 'Error: error:0308010C:digital envelope routines::unsupported'

In Create microservices with .NET and ASP.NET Core learn module when user tries to execute the Build the coupon service in Container Registry step WebSPA build fails with the following error.


 => ERROR [node-build 7/7] RUN npm run build:prod                                                                                                                                                          11.4s
------
 > [node-build 7/7] RUN npm run build:prod:
#41 1.137
#41 1.137 > [email protected] build:prod
#41 1.137 > ng build --prod --aot --extract-css
#41 1.137
#41 10.40 (node:19) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
#41 10.40 (Use `node --trace-deprecation ...` to show where the warning was created)
#41 11.20 Error: error:0308010C:digital envelope routines::unsupported
#41 11.20     at new Hash (node:internal/crypto/hash:67:19)
#41 11.20     at Object.createHash (node:crypto:130:10)
#41 11.20     at module.exports (/web/src/node_modules/webpack/lib/util/createHash.js:90:53)
#41 11.20     at NormalModule._initBuildHash (/web/src/node_modules/webpack/lib/NormalModule.js:401:16)
#41 11.20     at handleParseError (/web/src/node_modules/webpack/lib/NormalModule.js:449:10)
#41 11.20     at /web/src/node_modules/webpack/lib/NormalModule.js:481:5
#41 11.20     at /web/src/node_modules/webpack/lib/NormalModule.js:342:12
#41 11.20     at /web/src/node_modules/loader-runner/lib/LoaderRunner.js:370:3
#41 11.20     at iterateNormalLoaders (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:211:10)
#41 11.20     at iterateNormalLoaders (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:218:10)
#41 11.20     at /web/src/node_modules/loader-runner/lib/LoaderRunner.js:233:3
#41 11.20     at runSyncOrAsync (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
#41 11.20     at iterateNormalLoaders (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:229:2)
#41 11.20     at iterateNormalLoaders (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:218:10)
#41 11.20     at /web/src/node_modules/loader-runner/lib/LoaderRunner.js:233:3
#41 11.20     at context.callback (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
#41 11.20     at /web/src/node_modules/postcss-loader/src/index.js:197:9
#41 11.20     at processTicksAndRejections (node:internal/process/task_queues:96:5)
#41 11.26 node:internal/crypto/hash:67
#41 11.26   this[kHandle] = new _Hash(algorithm, xofLen);
#41 11.26                   ^
#41 11.26
#41 11.26 Error: error:0308010C:digital envelope routines::unsupported
#41 11.26     at new Hash (node:internal/crypto/hash:67:19)
#41 11.26     at Object.createHash (node:crypto:130:10)
#41 11.26     at module.exports (/web/src/node_modules/webpack/lib/util/createHash.js:90:53)
#41 11.26     at NormalModule._initBuildHash (/web/src/node_modules/webpack/lib/NormalModule.js:401:16)
#41 11.26     at /web/src/node_modules/webpack/lib/NormalModule.js:433:10
#41 11.26     at /web/src/node_modules/webpack/lib/NormalModule.js:308:13
#41 11.26     at /web/src/node_modules/loader-runner/lib/LoaderRunner.js:364:11
#41 11.26     at /web/src/node_modules/loader-runner/lib/LoaderRunner.js:200:19
#41 11.26     at VirtualFileSystemDecorator.readFile (/web/src/node_modules/@ngtools/webpack/src/virtual_file_system_decorator.js:46:13)
#41 11.26     at processResource (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:199:11)
#41 11.26     at iteratePitchingLoaders (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:158:10)
#41 11.26     at iteratePitchingLoaders (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
#41 11.26     at /web/src/node_modules/loader-runner/lib/LoaderRunner.js:173:18
#41 11.26     at loadLoader (/web/src/node_modules/loader-runner/lib/loadLoader.js:36:3)
#41 11.26     at iteratePitchingLoaders (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
#41 11.26     at runLoaders (/web/src/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
#41 11.26     at NormalModule.doBuild (/web/src/node_modules/webpack/lib/NormalModule.js:280:3)
#41 11.26     at NormalModule.build (/web/src/node_modules/webpack/lib/NormalModule.js:427:15)
#41 11.26     at Compilation.buildModule (/web/src/node_modules/webpack/lib/Compilation.js:635:10)
#41 11.26     at /web/src/node_modules/webpack/lib/Compilation.js:884:14
#41 11.26     at /web/src/node_modules/webpack/lib/NormalModuleFactory.js:405:6
#41 11.26     at /web/src/node_modules/webpack/lib/NormalModuleFactory.js:155:13
#41 11.26     at AsyncSeriesWaterfallHook.eval [as callAsync] (eval at create (/web/src/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
#41 11.26     at /web/src/node_modules/webpack/lib/NormalModuleFactory.js:138:29
#41 11.26     at /web/src/node_modules/webpack/lib/NormalModuleFactory.js:342:9
#41 11.26     at processTicksAndRejections (node:internal/process/task_queues:78:11) {
#41 11.26   opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
#41 11.26   library: 'digital envelope routines',
#41 11.26   reason: 'unsupported',
#41 11.26   code: 'ERR_OSSL_EVP_UNSUPPORTED'
#41 11.26 }
#41 11.26
#41 11.26 Node.js v17.0.1
------

No checks on registered resource providers

The setup scripts appear to enter an infinite loop if required resource providers are not registered prior to running. If this is your first venture into running AKS in your subscription that will be quite likely given that this is an introductory module.
I'm not 100% certain about this but there are errors in the activity log under "Create or Update Managed Cluster"

Operation name Create or Update Managed Cluster Time stamp Thu Jun 03 2021 08:00:29 GMT+0100 (British Summer Time) Event initiated by [email protected] Error code MissingSubscriptionRegistration Message The subscription is not registered to use namespace 'Microsoft.ContainerService'. See https://aka.ms/rps-not-found for how to register subscriptions.

This is the script output. Yes, it does take a long time to get the LB IP address so the error might not result in infinite loop.
Will test if I get more time

` > az network public-ip list -g MC_eshop-learn-rg_eshop-learn-aks_westus --query "[?tags.service=='ingress-nginx/ingress-nginx'].ipAddress" -otsv

Waiting for the load balancer IP address...

az network public-ip list -g MC_eshop-learn-rg_eshop-learn-aks_westus --query "[?tags.service=='ingress-nginx/ingress-nginx'].ipAddress" -otsv

Waiting for the load balancer IP address...

az network public-ip list -g MC_eshop-learn-rg_eshop-learn-aks_westus --query "[?tags.service=='ingress-nginx/ingress-nginx'].ipAddress" -otsv

Waiting for the load balancer IP address...

az network public-ip list -g MC_eshop-learn-rg_eshop-learn-aks_westus --query "[?tags.service=='ingress-nginx/ingress-nginx'].ipAddress" -otsv

Waiting for the load balancer IP address...

az network public-ip list -g MC_eshop-learn-rg_eshop-learn-aks_westus --query "[?tags.service=='ingress-nginx/ingress-nginx'].ipAddress" -otsv`

Linkerd sidecar proxy fails to start

Module Name :

https://docs.microsoft.com/en-us/learn/modules/microservices-resiliency-aspnet-core

Step that fails :

Unit : https://docs.microsoft.com/en-us/learn/modules/microservices-resiliency-aspnet-core/6-implement-linkerd-resiliency
Step: Deploy the updated Helm charts

Description:

When user tries to implement infrastructure level resiliency using Linkerd, linkerd sidecar proxy doesn't get created for the Coupon and WebShopping aggregator microservices.

By default Azure Cloud Shell installs Linkerd stable version 2.8.1 and with that when user tries to enable service mesh with AKS Version 1.20.9 side car proxy doesn't get created. In the linkerd logs it shows - linkerd-tap-7779d88fc7-ps42z tap 2021/11/26 11:23:08 http: TLS handshake error from 127.0.0.1:42388: remote error: tls: bad certificate

Possible Root Cause:

After debugging it's found that with linkerd 2.11.1 everything works fine. Though the setup script installs linkerd latest 2.11.1 but azure cloud shell still points to Linkerd version 2.8.1 and that's because the value of $PATH variable.

Workaround:

  • Edit vim ~/.bashrc file.
  • Remove first Linkerd/bin path to take up the latest.
  • After that it picked up the latest Linkerd version 2.11.1 stable release.
  • Thereafter the linkerd side car proxies for both Coupon and WebshoppingAgg are injected.

Parameterize script to allow to be run in WSL on a Windows PC or bash in MAC

It would be great if you could parameterize your scripts to allow them to be executed in WSL. I find executing the labs on my own machine in WSL clearer to understand because:

  • It's my local environment that I am used to
  • It supports multimonitor
  • Has a full version of VS Code
  • I can open as many instances of Code and Terminal as needed to help me understand what you are doing in these scripts

I think the amount of change would be reasonable because in most cases only ~/clouddrive/... needs to be put on a variable ... As a 20+ years Windows based Developer I learned a lot by fixing your bash scripts to work on WSL :-)

Deploy scripts cannot pull the image from the ACR

I have completely redone the exercises twice now in https://docs.microsoft.com/en-us/learn/modules/microservices-resiliency-aspnet-core/5-implement-polly-resiliency. When I get to the point after making code changes to implement retries, I run the command:

./deploy-application.sh --registry $ESHOP_REGISTRY --charts webshoppingagg

and it looks like it succeeds, but the POD never shows Running, but instead shows:

webshoppingagg-757c64787d-567zb 0/1 ImagePullBackOff 0 4m53s

Why can I not pull the updated image from the ACR into my AKS node and POD?

Error at Contoso Pets ProductsAdmin page

Hello, after setting up the development environment, and running the dotnet run and az webapp up commands I'm able to connect to my webpage URL. In Products Admin page this error appears:

An error occurred while processing your request.
Request ID: 8000160a-0000-e800-b63f-84710c7967bb
Development Mode
Swapping to the Development environment displays detailed information about the error that occurred.
The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.

The page does not display the list of products and I can't edit or delete an existing product, as shown in
https://docs.microsoft.com/en-us/learn/modules/create-razor-pages-aspnet-core/4-run-razor-pages-project

It makes it impossible to follow the tutorial, I've tried restarting the CloudShell terminal, re-running all of the commands provided with no luck.

Instrument a cloud-native ASP.NET Core microservice - Monitor Application Insights

While doing Exercise - Monitor Application Insights telemetries end up empty due to DependencyResolutionException.

Output of Coupon container:

[08:31:27 WRN] Failed to resolve TelemetryConfiguration.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating λ:Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration -> Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptions -> λ:Microsoft.Extensions.Options.IConfigureOptions1[[Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration, Microsoft.ApplicationInsights, Version=2.20.0.103, Culture=neutral, PublicKeyToken=31bf3856ad364e35]][] -> Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptionsSetup -> λ:Microsoft.ApplicationInsights.Extensibility.ITelemetryInitializer[] -> Microsoft.ApplicationInsights.Kubernetes.KubernetesTelemetryInitializer -> Microsoft.ApplicationInsights.Kubernetes.K8sEnvironmentFactory -> Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider. ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(System.String, System.String, System.String, System.String, System.String, System.String)' on type 'KubeHttpClientSettingsProvider'. ---> System.InvalidCastException: Can't figure out container id. Input: 0::/ . Pattern: cpu.+/([^/]*)$ at Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider.ParseContainerId(String content) at Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider.FetchContainerId(String pathToCGroup) at Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider..ctor(String pathToToken, String pathToCert, String pathToNamespace, String pathToCGroup, String kubernetesServiceHost, String kubernetesServicePort) at lambda_method36(Closure , Object[] ) at Autofac.Core.Activators.Reflection.BoundConstructor.Instantiate() --- End of inner exception stack trace --- at Autofac.Core.Activators.Reflection.BoundConstructor.Instantiate() at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Activators.Reflection.ReflectionActivator.b__11_0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.DelegateMiddleware.Execute(ResolveRequestContext context, Action1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next)
--- End of inner exception stack trace ---
at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.RegistrationPipelineInvokeMiddleware.Execute(ResolveRequestContext context, Action1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.SharingMiddleware.<>c__DisplayClass5_0.b__0()
at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid id, Func1 creator) at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid primaryId, Nullable1 qualifyingId, Func1 creator) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext ctxt) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.Execute(ResolveRequest request) at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.ResolveOptional(IComponentContext context, Type serviceType, IEnumerable1 parameters)
at Autofac.ResolutionExtensions.ResolveOptional(IComponentContext context, Type serviceType)
at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.ApplicationInsights.AspNetCore.ApplicationInsightsStartupFilter.<>c__DisplayClass2_0.b__0(IApplicationBuilder app)

Output of Ordering container:

[08:31:31 WRN] Failed to resolve TelemetryConfiguration.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating λ:Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration -> Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptions -> λ:Microsoft.Extensions.Options.IConfigureOptions1[[Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration, Microsoft.ApplicationInsights, Version=2.20.0.103, Culture=neutral, PublicKeyToken=31bf3856ad364e35]][] -> Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptionsSetup -> λ:Microsoft.ApplicationInsights.Extensibility.ITelemetryInitializer[] -> Microsoft.ApplicationInsights.Kubernetes.KubernetesTelemetryInitializer -> Microsoft.ApplicationInsights.Kubernetes.K8sEnvironmentFactory -> Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider. ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(System.String, System.String, System.String, System.String, System.String, System.String)' on type 'KubeHttpClientSettingsProvider'. ---> System.InvalidCastException: Can't figure out container id. Input: 0::/ . Pattern: cpu.+/([^/]*)$ at Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider.ParseContainerId(String content) at Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider.FetchContainerId(String pathToCGroup) at Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider..ctor(String pathToToken, String pathToCert, String pathToNamespace, String pathToCGroup, String kubernetesServiceHost, String kubernetesServicePort) at lambda_method337(Closure , Object[] ) at Autofac.Core.Activators.Reflection.BoundConstructor.Instantiate() --- End of inner exception stack trace --- at Autofac.Core.Activators.Reflection.BoundConstructor.Instantiate() at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Activators.Reflection.ReflectionActivator.b__11_0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.DelegateMiddleware.Execute(ResolveRequestContext context, Action1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next)
--- End of inner exception stack trace ---
at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.RegistrationPipelineInvokeMiddleware.Execute(ResolveRequestContext context, Action1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.SharingMiddleware.<>c__DisplayClass5_0.b__0()
at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid id, Func1 creator) at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid primaryId, Nullable1 qualifyingId, Func1 creator) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext ctxt) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.Execute(ResolveRequest request) at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request) at Autofac.Core.Container.ResolveComponent(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.ResolveOptional(IComponentContext context, Type serviceType, IEnumerable1 parameters)
at Autofac.ResolutionExtensions.ResolveOptional(IComponentContext context, Type serviceType)
at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.ApplicationInsights.AspNetCore.ApplicationInsightsStartupFilter.<>c__DisplayClass2_0.b__0(IApplicationBuilder app)

Output of Webshoppingagg container:

[08:31:31 WRN] Failed to resolve TelemetryConfiguration.
System.InvalidCastException: Can't figure out container id. Input: 0::/
. Pattern: cpu.+/([^/]*)$
at Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider.ParseContainerId(String content)
at Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider.FetchContainerId(String pathToCGroup)
at Microsoft.ApplicationInsights.Kubernetes.KubeHttpClientSettingsProvider..ctor(String pathToToken, String pathToCert, String pathToNamespace, String pathToCGroup, String kubernetesServiceHost, String kubernetesServicePort)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ApplicationInsightsExtensions.<>c.<AddTelemetryConfigAndClient>b__35_0(IServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func`2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.ApplicationInsights.AspNetCore.ApplicationInsightsStartupFilter.<>c__DisplayClass2_0.b__0(IApplicationBuilder app)

unable to recognize "ingress-controller/nginx-controller.yaml"

Hi, I'm new to microservies, when I was setting the environment, I got following errors.

unable to recognize "ingress-controller/nginx-controller.yaml": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1beta1"
unable to recognize "ingress-controller/nginx-controller.yaml": no matches for kind "Role" in version "rbac.authorization.k8s.io/v1beta1"
unable to recognize "ingress-controller/nginx-controller.yaml": no matches for kind "RoleBinding" in version "rbac.authorization.k8s.io/v1beta1"
unable to recognize "ingress-controller/nginx-controller.yaml": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1"

Seems like it happens in the script editorHomeLocation/deploy/k8s/quickstart.sh

I did some research about it and tried to fix it manually followed by change v1beta1 to v1


Another issue is related to Helm

Installing chart "apigateway"...
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "extensions/v1beta1"

Installing chart "basket"...
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "extensions/v1beta1"

Installing chart "catalog"...
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "extensions/v1beta1"

Installing chart "coupon"...
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "extensions/v1beta1"

Installing chart "identity"...
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "extensions/v1beta1"

Installing chart "seq"...
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "extensions/v1beta1"

Installing chart "ordering"...
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "extensions/v1beta1"

Installing chart "webspa"...
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "extensions/v1beta1"

Installing chart "webstatus"...
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "extensions/v1beta1"

I also did some research and tried to fix them followed by https://stackoverflow.com/questions/69517855/microk8s-dashboard-using-nginx-ingress-via-http-not-working-error-no-matches


After I did the fix, seems the setup is OK, but I can't get the site reachable, all links in cat ~/clouddrive/aspnet-learn/deployment-urls.txt are not working.

dotnet-aspnet-codegenerator not installing, compatibility mismatch

$> dotnet tool install -g dotnet-aspnet-codegenerator

error NU1202: Package dotnet-aspnet-codegenerator 3.0.0 is not compatible with netcoreapp2.2 (.NETCoreApp,Version=v2.2) / any. Package dotnet-aspnet-codegenerator 3.0.0 supports: netcoreapp3.0 (.NETCoreApp,Version=v3.0) / any
Tool 'dotnet-aspnet-codegenerator' failed to update due to the following:
The tool package could not be restored.
Tool 'dotnet-aspnet-codegenerator' failed to install. This failure mayhave been caused by:

  • You are attempting to install a preview release and did not use the --version option to specify the version.
  • A package by this name was found, but it was not a .NET Core tool.
  • The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
  • You mistyped the name of the tool.

Load balancer wasn't ready

I get this error while running the quickstart script
kubectl get svc -n ingress-nginx -o json | jq -r -e '.items[0].status.loadBalancer.ingress[0].ip // empty'

The connection to the server localhost:8080 was refused - did you specify the right host or port?
Load balancer wasn't ready. If this takes more than a minute or two, something is probably wrong. Trying again in 5 seconds...

[Question] Deployment: Pre-configured conainers vs local containers

I followed the lab from the link below:
https://docs.microsoft.com/en-us/learn/modules/microservices-aspnet-core/7-update-aks-deployment

However, I wonder what changes have been made to the containers below?
I want to change it locally if possible, so I can learn more about the process of using Helm and AKS.

Install the reconfigured WebStatus and aggregator Helm charts by using a public container registry.

Below is the deployment script
\mslearn-aspnet-core\modules\microservices-aspnet-core\src\deploy\k8s\update-aks.sh

# Install reconfigured charts from Docker Hub
for chart in webstatus webshoppingagg
do
    echo
    echo "Installing chart \"$chart\"..."
    echo "${newline}${genericCommandStyle}helm install eshop-$chart --set registry=eshoplearn --set aksLB=$ESHOP_LBIP \"helm-simple/$chart\"${defaultTextStyle}${newline}"
    helm install eshop-$chart --set registry=eshoplearn --set aksLB=$ESHOP_LBIP "helm-simple/$chart"
done

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.