This project contains all the required source code / binaries to setup labs for APIM troubleshooting series. Here are the steps you need to follow in sequential fashion to setup the lab:-
-
Install Git client for windows. You can download the setup file from here : https://git-scm.com/download/win
-
Git clone or download the backend API project from this GitHub repo : https://github.com/prchanda/ProductStore
-
Deploy / publish the ProductStore solution (backend API project) to a new or existing App Service using Visual Studio or any other deployment tool of your choice. Refer this article : https://tutorials.visualstudio.com/aspnet-azure/publish
-
Create an APIM instance. You can refer this article : https://docs.microsoft.com/en-us/azure/api-management/get-started-create-service-instance
-
Download the APIM lab GitHub repository apimlab.scm.azure-api.net.zip from here : https://github.com/prchanda/apimlab/blob/master/apimlab.scm.azure-api.net.zip and extract it in your local drive.
-
Navigate to the extracted directory and run the following git commands in sequence to push the local repository to your APIM Git repository.
git remote set-url origin {Your APIM repository URL}
git push -f origin master
-
Click on the "Deploy to API Management" option to trigger the APIM deployment from it's Git repository.
-
Open up the Azure Portal and navigate to your APIM instance created in step 4. Under APIs blade change the backend url of the
ProductStore
API to the your App Service endpoint like below and Save it.
While pushing your local Git content to APIM, you may encounter few errors like below. Solution to those errors are included as well.
- fatal: Authentication failed for 'https://apimlab.scm.azure-api.net/'
This type of error can occur if your Git credentials are out of sync with your local windows credential manager. Try the following steps to Edit or Remove the saved credentials:
- Click Start and type:
Credential Manager
. - Double click
Windows Credentials Manager
shortcut to open the application. - Once the application is opened, click on the
Windows Credentials
tab. - Locate the credentials that you want to remove/update, they will start with "git:" and might begin with "ada:".
- Click on the credential entry, it will open a details view of the entry.
- Click Edit or Remove as required and confirm.
If your local Git repository is corrupted you may get these below errors. Running git repack
command should fix the corruption.
- remote: error: unable to write sha1 filename ./objects/pack/pack-5aa087b92d89d817608f3f7809848e2297dea2d6.pack: Permission denied
- remote: fatal: cannot store pack file
- error: remote unpack failed: index-pack abnormal exit