Short answer: Azure OpenAI security checklist: managed identity, private endpoints with DNS, Prompt Shields and content filtering, in the order I would set them up.
Most Azure OpenAI apps start the same way. Someone pastes an API key into a config file, the demo works, and the app slowly becomes a real product with that same key still sitting in it.
Azure OpenAI security is easy to postpone because the model call just works. But the key, the public endpoint and the unfiltered input are three open doors, and they’re all fixable in a day or two.
This is the checklist I’d walk through before putting an Azure OpenAI based app in front of real users. By the end you should be able to decide what to lock down first and what can wait.
Why Azure OpenAI Security Needs More Than a Good Key
A chat app has more attack surface than a normal API. There’s the credential, the network path, the text your users type, and the documents or web pages you feed into the prompt.
Each one fails in a different way. A leaked key lets anyone spend your money. A public endpoint lets traffic in from anywhere. And a hostile prompt can try to talk the model out of its instructions.
No single feature covers all of that. So I think of it as four layers: identity, network, input and output controls, and governance.
Identity: Use Managed Identity Instead of API Keys
The docs describe Microsoft Entra ID authentication as a way to call your Azure OpenAI resource without storing a key in your application. Your code asks for a short-lived token for an identity that has a role on the resource.
A managed identity is one kind of Entra identity. Azure creates it, attaches it to a resource such as a web app or VM, and rotates the credentials for you. There’s no secret to store.
Two details trip people up:
- Custom subdomain: Entra ID authentication needs your Azure OpenAI resource to have one, so check this early.
- Role assignment: the identity only works once it has a role on the resource. Grant the narrowest one that lets the app do its job.
The DefaultAzureCredential class from the Azure Identity library tries a chain of credentials. On your laptop it picks up your az login session, and on an Azure host it picks up the managed identity. Same code, no keys in either place.
Network: Private Endpoint Setup and the DNS Part Everyone Forgets
A private endpoint gives the resource a private IP inside your virtual network. That’s the easy half.
The half that causes outages is DNS. The docs say the private endpoint’s IP has to resolve to the same fully qualified name your apps already use. Your connection URLs don’t change, so the name must resolve to the private address from inside your network.
You have a few options for that:
- Private DNS zone: the usual choice. Link it to your virtual network and it overrides resolution for that service’s domain.
- Azure Private Resolver: useful when you need to forward DNS queries between networks.
- Hosts file: fine for a quick test, and the docs only recommend it for testing.
One warning from the same page: don’t put records for several different services into one private DNS zone. Create a zone per service type, or one endpoint can delete another’s A-record and you’ll chase resolution errors.
Prompt Injection, Prompt Shields and Content Safety
Content filtering in Foundry is powered by Azure AI Content Safety. It runs both the prompt and the completion through classification models that look for harmful content. It doesn’t apply to embedding models or audio models such as Whisper, so don’t assume it covers every call you make.
Prompt injection is a separate problem, and that’s where Prompt Shields come in. They look for two kinds of attack:
- User prompt attacks: a user trying to bypass the system instructions or safety training.
- Document attacks: hidden instructions inside documents, emails or web pages that try to hijack the session.
In Foundry, user prompt attack detection is on by default. Document attack detection is off by default, so you have to switch it on in your guardrail controls. If your app summarises emails or reads web pages, I’d turn it on first.
Where This Goes Wrong
Prompt Shields detect attempts to manipulate the model. They don’t tell you whether content is harmful, accurate, grounded in your data or inside your policy. You need other controls for those.
They’re also trained and evaluated mostly on English. The docs suggest testing with realistic attacks and normal content in every language your app supports.
And when you call the Content Safety APIs directly, the API doesn’t block anything itself. It returns results, and your code decides what to do with them. That’s a decision you have to make on purpose.
What I’d Do First
If I had one afternoon, this is the order I’d work in:
- Move the app to managed identity and delete the key from config.
- Add the private endpoint and test DNS from inside the network.
- Confirm user prompt attack detection is on, and enable document attack detection if the app reads outside content.
- Put an API Management gateway in front if several teams share the models.
The AI gateway in Azure API Management helps with authentication, monitoring and token quotas across apps. That last one matters when one noisy app can starve the rest.
A Practical Example
Say you’re building an internal assistant that reads support emails and drafts replies, running on App Service.
First, you enable a system-assigned managed identity and give it the role it needs on the Azure OpenAI resource. The key goes out of app settings.
Next, you add a private endpoint, link a private DNS zone to the virtual network, and check from the app that the resource name resolves to a private address.
Then comes the part people skip. Emails are untrusted documents, so you turn on document attack detection and decide what happens when something is flagged. Maybe the draft is held for a human instead of sent.
None of that needs new architecture. It’s configuration, plus one decision about what the app does when a check fails.
Final Thoughts
Azure OpenAI security isn’t one switch. Identity removes the secret, the private endpoint removes the public path, and the content controls handle what goes in and comes out. Each is cheap to add early and annoying to add late.
One more thing: the docs say your prompts and completions aren’t available to other customers or to OpenAI, and aren’t used to train foundation models without your permission. That covers where the data goes. It doesn’t cover how your own app uses it, which is still your job.
Which of these four layers is the weakest in the app you’re running today?
#AzureOpenAISecurity #Azure #AzureOpenAI #ManagedIdentity #PromptInjection #CloudSecurity #Microsoft
Key takeaways
- A chat app has more attack surface than a normal API.
- The docs describe Microsoft Entra ID authentication as a way to call your Azure OpenAI resource without storing a key in your application.
- A private endpoint gives the resource a private IP inside your virtual network.
- Content filtering in Foundry is powered by Azure AI Content Safety.
- Prompt Shields detect attempts to manipulate the model.
Related reading and services: our Azure AI services team, recent case studies. Official reference: Azure OpenAI documentation.
Planning something like this?
Talk to our engineers. Contact Prilixor or see our US team for a conversation about your project.
Originally published on LinkedIn.