Cómo crear Key Vault en Azure con CMD Guía paso a paso

Azure Key Vault: protege secretos con RBAC o políticas, guía CLI paso a paso y buenas prácticas para despliegues seguros en la nube.

8 sept 2025 • 3 min read • Q2BSTUDIO Team

Inteligencia-Artificial-

Qué es Azure Key Vault Azure Key Vault es un servicio en la nube de Microsoft para almacenar y proteger información sensible como secretos contraseñas, cadenas de conexión, claves de API, claves de cifrado y certificados SSL TLS. En lugar de dejar secretos en el código o en archivos de configuración, los guardas en Key Vault y tu aplicación los recupera de forma segura cuando los necesita.

Guía paso a paso en CMD

Paso 1 Inicia sesión en Azure con az login. Se abrirá el navegador para validar tu cuenta. Si tu suscripción aparece listada como la número 1 en consola, escribe 1 para seleccionarla y completar el inicio de sesión.

Paso 2 Crea el grupo de recursos con este comando az group create --name myresourcegroup --location eastus

Paso 3 Crea el Key Vault con este comando az keyvault create --name mykeydaniel123 --resource-group myresourcegroup --location eastus

Ventaja de usar CLI En lugar de hacer clics en el portal, puedes automatizar todo con scripts reutilizables y versionables, lo que mejora la seguridad, trazabilidad y repetibilidad de tus despliegues.

Paso 4 Asigna permisos con RBAC para poder gestionar secretos. Para evitar espacios en el nombre del rol, usa el identificador del rol Key Vault Administrator con este comando az role assignment create --assignee 3095d940-46b7-4239-bfed-f46a193281c1 --role 00482a5a-887f-4fb3-b363-3b7fe8e74483 --scope /subscriptions/fdf2e0bf-0c36-45cc-8ae5-2f2e84aa3dbe/resourceGroups/myresourcegroup/providers/Microsoft.KeyVault/vaults/mykeydaniel123

Nota alternativa Si tu bóveda está configurada con Access Policies en lugar de RBAC, puedes otorgar permisos así az keyvault set-policy --name mykeydaniel123 --object-id 3095d940-46b7-4239-bfed-f46a193281c1 --secret-permissions get list set delete

Paso 5 Guarda un secreto con este comando az keyvault secret set --name mysecret --value kolawole@123 --vault-name mykeydaniel123 Almacenar secretos mediante CLI mantiene tus credenciales cifradas, centralizadas y auditables, evitando exponerlas en código o variables de entorno.

Paso 6 Recupera el valor del secreto así az keyvault secret show --vault-name mykeydaniel123 --name mysecret --query value -o tsv Esto devuelve únicamente el valor del secreto en texto plano en la consola, ideal para integraciones en scripts.

Paso 7 Lista los secretos disponibles az keyvault secret list --vault-name mykeydaniel123 -o table Este listado es útil para verificar versiones y estados habilitado o deshabilitado.

Reflejo en el portal de Azure Todo lo creado por CLI se ve al instante en el portal de Azure. Podrás comprobar el grupo de recursos, la bóveda, los secretos y las asignaciones de roles en sus respectivas secciones.

Buenas prácticas rápidas usa nombres únicos globales para el Key Vault, limita el acceso con el principio de mínimo privilegio, habilita registros de auditoría con Azure Monitor, rota secretos periódicamente y evita mostrar valores en la consola en entornos compartidos.

Cómo te ayuda Q2BSTUDIO En Q2BSTUDIO impulsamos la seguridad y la eficiencia de tus proyectos con servicios de software a medida y aplicaciones a medida, integración de inteligencia artificial, ciberseguridad, automatización y datos. Diseñamos arquitecturas seguras en la nube y automatizamos la gestión de secretos con pipelines CI CD para que tus despliegues sean consistentes y seguros. Si buscas expertos en servicios cloud aws y azure, descubre cómo te acompañamos en arquitectura, migración y operación en la nube en servicios cloud AWS y Azure. Además, integramos casos de uso de ia para empresas con agentes IA, asistentes internos y analítica avanzada soportada por power bi y servicios inteligencia de negocio. Conoce nuestro enfoque de valor en inteligencia artificial para empresas.

Palabras clave relacionadas aplicaciones a medida, software a medida, inteligencia artificial, ciberseguridad, servicios cloud aws y azure, servicios inteligencia de negocio, ia para empresas, agentes IA, power bi.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Artificial intelligence

AI agents, chatbots, and intelligent assistants that automate tasks and serve your customers 24/7 to improve the efficiency of your business.

More info

Software Development

Web, mobile, and desktop applications, intranets, e-commerce, SaaS, and management platforms designed for your company's specific needs.

More info

Cloud services

Migration, infrastructure, managed hosting, high availability, and security on Microsoft Azure and Amazon Web Services to help your business scale without limits.

More info

Cybersecurity and pentesting

Security audits, penetration testing and protection of applications, data and infrastructure on-premise and cloud, with ethical hacking and regulatory compliance.

More info

Business Intelligence

Dashboards and data analysis with Power BI: we integrate your sources, design dashboards and KPIs and turn your data into decisions.

More info

Process automation

We automate repetitive tasks and connect your applications with n8n, Power Automate, Make, and RPA, eliminating manual work and increasing productivity.

More info

Training for Companies

We train your teams in technology with criteria: web development, databases, Git, best practices and security, automation with n8n, artificial intelligence for companies and creation of AI solutions with Azure AI Foundry.

More info

Code Auditing

We audit the code that you, your team or an AI create: we tell you what is good and what to improve, we secure it and make it ready for production, web or app.

More info

AI Image Generation

We create for you the images that your business needs with artificial intelligence: product, networks, advertising, illustration and avatars. You tell us what you want and we deliver it ready to use.

More info

AI Video Generation

We create videos with artificial intelligence for you: promotional, networking, virtual presenters, dubbing and animations. You tell us the idea and we will deliver it assembled and ready to publish.

More info

AI Conversational Avatars

We create conversational avatars with AI – digital humans with a face and voice – that serve your customers and teams with the knowledge of your company, on your website, interactive monitors, WhatsApp or Teams.

More info

Online Marketing and AI

Google Ads, Meta Ads, LinkedIn Ads and AI Engine Positioning (GEO/AEO): we attract customers and make your brand appear where they search for you, also on ChatGPT, Gemini and Perplexity.

More info

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.