Example prompts for troubleshooting your application with GitHub Copilot for Azure Preview
If you're unfamiliar with Azure or you just want the tooling and AI to do most of the work, you can ask GitHub Copilot for Azure Preview to help you troubleshoot problems with your application.
Best practices
Using copilots can increase developer productivity by answering questions, executing tasks, and generating code. However, remember these vital rules:
- Review all AI-generated responses. Validate their correctness, applicability, potential outcomes (such as costs and security) before taking action based on those responses.
- Never save application secrets or credentials in source code.
- Never submit application secrets or credentials in questions or in code when you ask questions.
When you're working with any tool that's based on large language models, use good prompt engineering techniques for the best results. The following tips come from the article Write effective prompts for Microsoft Copilot in Azure, which provides advice for prompt engineering in the context of Azure.
- Be clear and specific
- Set expectations
- Add context about your scenario
- Break down your requests
- Customize your code
- Use Azure terminology
- Use the feedback loop
Example prompts for troubleshooting your app
If you want to use GitHub Copilot for Azure Preview for help with troubleshooting your application, you can start with an open-ended question or request. Then, add details for better results.
Open-ended prompts
- "@azure Where can I find metrics and logs?"
- "@azure I want to see all the error messages in the logs."
- "@azure I'm seeing errors with my app. Look at the logs to find out why."
- "@azure Why are my clients being disconnected so often?"
- "@azure Why did my last deployment fail?"
- "@azure Help me analyze my app for high CPU usage."
- "@azure Why is my application slow?"
- "@azure Take a memory dump of my app."
Prompts about specific timeframes
- "@azure Grab all the errors in the logs between yesterday and today."
- "@azure Diagnose my app to show me what problems it encountered."
- "@azure Tell me what goes wrong with my app 'myAppName'."
- "@azure Troubleshoot my app for any possible issues in the last 3 hours."
- "@azure What errors did my app 'myAppName' have in the last 24 hours?"
Prompts about specific errors
- "@azure Is there any 501 error in my app logs?"
- "@azure Why am I seeing a 500 error when opening my website?"
- "@azure I'm getting an xxx error code. What could be the reasons?"
- "@azure Show me all the 4xx errors in the logs in the last 6 hours."
- "@azure Find error messages in the logs that might correlate to 500 errors."
Prompts about specific services and technologies
Service or technology | Troubleshoot prompt examples |
---|---|
Azure Container Apps |
|
Azure Kubernetes Service (AKS) |
|
Azure App Service |
|
Azure Developer CLI (azd ) |
|
Azure SDK |
|
Azure Event Hubs |
|
Azure OpenAI Service |
|
Azure SignalR Service |
|
Azure Storage |
|
Azure Web PubSub |
|
Related content
- Understand what GitHub Copilot for Azure Preview is and how it works.
- Get started with GitHub Copilot for Azure by installing the software and writing your first prompt.
- Follow the quickstart to understand how to include GitHub Copilot for Azure Preview in your software development workflow. The quickstart describes how to deploy services to Azure, monitor their status, and troubleshoot problems.
- See example prompts for learning more about Azure and understanding your Azure account, subscription, and resources.
- See example prompts for deploying your application to Azure.
- See example prompts for optimizing your applications in Azure.